<?php

class Framework_Model_DbTable_Frameworks extends Zend_Db_Table_Abstract
{
    protected $_name = 'framework';
    protected $_primary = 'id';
    
    
   public function addFramework($data){
        
       $params['name'] = array_key_exists('name', $data) ? $data['name'] : '';
       $params['url'] = array_key_exists('url', $data) ? $data['url'] : '';
       $params['price'] = array_key_exists('price', $data) ? $data['price'] : '';
       $params['description'] = array_key_exists('description', $data) ? $data['description'] : '';
       
       $lastInsertId = $this->insert($params);
       return $lastInsertId;
   } 
   
  public function updateFramework($id,$data){
       $params['name'] = array_key_exists('name', $data) ? $data['name'] : '';
       $params['url'] = array_key_exists('url', $data) ? $data['url'] : '';
       $params['price'] = array_key_exists('price', $data) ? $data['price'] : '';
       $params['description'] = array_key_exists('description', $data) ? $data['description'] : '';
      
       $updated = $this->update($params,"id = $id");
       return $updated;
  }
  
  public function deleteFramework($id){
      $deleted = $this->delete("id=$id");
      return $deleted;
  }
}

